

void main ()
{
	TRISC=0x00;
	TRISB.0=1;
	TRISA.4=1;
	uns16 belt = 0;	//belt is straped or not
	uns16 sit = 0;	//someone sitting in the siet or not
	uns16 i;
	
	
	while (1)				//while runing
	{
		belt = 0;			//sets beelt and sit to 0
		sit = 0;
		
		if (!PORTA.4)	//someone straps belt on
		{		
			belt=1;
		}	

		if(!PORTB.0)			//some one sits down
		{
			sit=1;
		}
		if(sit && !belt)		//is someone sitting whitout the belt on
		{
			PORTC.2 = 1;
			for (i=0;i<50;)
			{
				i++
		
			}
		}
	}
}